﻿<%@ Page Title="Incoming Payments" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="Incoming.aspx.cs" Inherits="SAP.Incoming" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        Main.myUpdatePanelId = '<%= purchaseOrderUpdatePanel.ClientID %>';
    </script>
    <asp:UpdatePanel ID="purchaseOrderUpdatePanel" runat="server">
        <ContentTemplate>
            <div id="contentData" style="padding-left: 15px;">
                <div id="menu-action" style="margin-left: -15px;">
                    <ul>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/preview.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/print.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/email.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/excel.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/pdf.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/word.png" /></a></li>
                         
                        <li>
                            <asp:HyperLink ID="linkNew" runat="server"> <asp:Image ID="Image8" runat="server" ImageUrl="~/skin/icon/addnew.png" /></asp:HyperLink>
                        </li>

                        <li>
                            <asp:HyperLink ID="linkFirst" runat="server"> <asp:Image ID="Image4" runat="server" ImageUrl="~/skin/icon/first.png" /></asp:HyperLink>
                        </li>
                        <li>
                            <asp:HyperLink ID="linkPrevious" runat="server"> <asp:Image ID="Image5" runat="server" ImageUrl="~/skin/icon/previous.png" /></asp:HyperLink>
                        </li>
                        <li>
                            <asp:HyperLink ID="linkNext" runat="server"> <asp:Image ID="Image6" runat="server" ImageUrl="~/skin/icon/next.png" /></asp:HyperLink>
                        </li>
                        <li>
                            <asp:HyperLink ID="linkLast" runat="server"> <asp:Image ID="Image7" runat="server" ImageUrl="~/skin/icon/last.png" /></asp:HyperLink>
                        </li>
                 </ul>                    
                </div>
                <div class="clear">
                </div>
                <div id="title-form" style="border-bottom: 2px solid black;">
                    <h2>
                        INCOMING PAYMENTS</h2>
                    <asp:Label BackColor="Red" ID="lblResults" runat="server" />
                </div>
                <div id="header-form">
                    <div class="left">
                        <table class="detail_table">
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Code</span>
                                    <asp:HyperLink ID="lBP" runat="server"> <asp:Image ID="Image2" runat="server" ImageUrl="~/skin/icon/link.png"/></asp:HyperLink>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtVendor" runat="server" Enabled="False" ToolTip="txtVendor"></asp:TextBox>
                                    <asp:HyperLink ID="linkVendorsLoad" NavigateUrl="javascript:Main.openDialog('../Popup_EditBusinessPartner.aspx?CardType=C','');"
                                        runat="server"> <asp:Image ID="imgVendorsLoad" runat="server" ImageUrl="~/skin/images/item-pointer.gif" /></asp:HyperLink>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Name</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtName" runat="server" ToolTip="txtName"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Contact Person</span>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlContactPerson" runat="server" 
                                        ToolTip="ddlContactPerson">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Address</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAddress" runat="server" Height="40px" TextMode="MultiLine" 
                                        ToolTip="txtAddress" ></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Project</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtProject" runat="server" Enabled="False" 
                                        ToolTip="txtProject"></asp:TextBox>
                                    <asp:HyperLink ID="linkVendorsLoad0" runat="server" 
                                        NavigateUrl="javascript:Main.openDialog('../Popup_EditProject.aspx','');"> <asp:Image ID="imgVendorsLoad0" 
                                        runat="server" ImageUrl="~/skin/images/item-pointer.gif" /></asp:HyperLink>
                                </td>
                            </tr>
                        </table>
                    </div>
                    
                    <div class="right">
                        <table class="detail_table">
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                    <span>No</span>&nbsp;</td>
                                <td>
                                    <asp:TextBox ID="txtNo" runat="server" Enabled="false" Text="" ToolTip="txtNo"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                    <span>Posting Date</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPostingDate" runat="server" CssClass="txtDate"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                    <span>Due Date</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDueDate" runat="server" CssClass="txtDate"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                    <span>Document Date</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDocumentDate" runat="server" CssClass="txtDate"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                    <span>Reference</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCounterRef" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                    <span>Transaction No.</span>
                                    <asp:HyperLink ID="hlJE" runat="server">
                                                <asp:Image ID="Image14" runat="server" 
                                        ImageUrl="~/skin/icon/link.png"/>
                                          </asp:HyperLink>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtTransID" runat="server" Enabled="False"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                    <span>Tax Code</span>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlTaxCode" runat="server">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="clear">
                </div>
                <div id="content-form">
                    <div id="tabs">
                        <ul>
                            <li><a href="#tabs-1">Contents</a></li>
                            <li><a href="#tabs-2">Payment Means</a></li>
                        </ul>
                        <div id="tabs-1" style="overflow: auto; height: 200px; margin-top: 0px;">
                            
                            <br />
                            <asp:ListView ID="lvContents" runat="server" ViewStateMode="Enabled" 
                                onitemcommand="lvContents_ItemCommand" 
                                onitemupdating="lvContents_ItemUpdating" >
                                <LayoutTemplate>
                                    <table class="data_table">
                                        <tr>
                                            <th style="width: 30px">
                                            </th>
                                            <th style="width: 30px">
                                                <span>No</span>
                                            </th>
                                            <th style="width: 80px">
                                                <span>Document No.</span>
                                            </th>
                                            <th style="width: 50px">
                                                <span>Document Type</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Date</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Due Date</span>
                                            </th>
                                            <th style="width: 60px">
                                                <span>Overdue</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Balance Due</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Total Payment</span>
                                            </th>
                                            <th style="width: 78px">
                                            </th>
                                            <th style="display:none">
                                            </th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="ckCheck" runat=server OnCheckedChanged="UpdateCheckBox"  AutoPostBack="true" />
                                        </td>  
                                        <td>
                                            <asp:Label runat="server" ID="lblNo" Text='<%#Eval("No")%>'></asp:Label>
                                        </td>                                      
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblDocEntry" Text='<%#Eval("DocEntry")%>'></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblCode"><%#Eval("InvType")%></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblDescription" ><%#Eval("RefDate")%></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblQuantity" Text='<%# Eval("DueDate") %>'></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblUnitPrice"><%#Eval("Overdue")%></asp:Label>
                                        </td>
                                        <td style="text-align: right">
                                            <asp:Label runat="server" ID="lblDiscount"><%#Eval("BalDueDeb")%></asp:Label>
                                        </td>
                                       <td style="text-align: right">
                                             <asp:TextBox runat="server" ID="txtSumApplied" Style="text-align: right" Text='<%#Bind("SumApplied")%>' />
                                        </td>
                                        <td>
                                            <asp:LinkButton ID="imgbUpdate" runat="server" CommandName="Update" Text="Update"
                                                ImageUrl="~/skin/icon/save_icon_mono.gif" CausesValidation="true" ValidationGroup="vgrpSaveContact" />
                                            <asp:LinkButton ID="imgbCancel" runat="server" CommandName="CancelUpdate" Text="Cancel"
                                                ImageUrl="~/skin/icon/undo_icon_mono.gif" CausesValidation="false" />
                                        </td>
                                        <td  style="display:none">
                                            <asp:Label runat="server" ID="Label2"><%#Eval("DocLine")%></asp:Label>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <EmptyDataTemplate>
                                    <table class="data_table">
                                        <tr>
                                            <th style="width: 100px">
                                                <span>Selected</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Document No.</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Document Type</span>
                                            </th>
                                            <th style="width: 50px">
                                                <span>Date</span>
                                            </th>
                                            <th style="width: 80px">
                                                <span>Due Date</span>
                                            </th>
                                            <th style="width: 60px">
                                                <span>Overdue</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Balance Due</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Total Payment</span>
                                            </th>
                                             <th style="width: 50px">
                                            </th>
                                             <th style="display:none">
                                            </th>
                                        </tr>
                                        <tr>
                                            <td colspan="9">
                                                <span>No Data</span>
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                            </asp:ListView>
                            
                            
                        </div>
                       <div id="tabs-2">
                            <div >
                                <table class="detail_table">

                                    <tr>
                                        <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                            <span>Cash Account</span>
                                            
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCashAccount" runat="server" Enabled="False"></asp:TextBox>
                                            <asp:HyperLink ID="linkOwner0" runat="server" 
                                                NavigateUrl="javascript:Main.openDialog('../Popup_EditAccount.aspx','id=1');"> 
                                             <asp:Image ID="Image3" runat="server" ImageUrl="~/skin/images/item-pointer.gif" /></asp:HyperLink>
                                             <asp:Label ID="lblCashAccountName" runat=server />
                                        </td>

                                         <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                            <span>Transfer Account</span>
                                            
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtTransferAccount" runat="server" Enabled="False"></asp:TextBox>
                                            <asp:HyperLink ID="HyperLink1" runat="server" 
                                                NavigateUrl="javascript:Main.openDialog('../Popup_EditAccount.aspx','id=2');"> 
                                             <asp:Image ID="Image1" runat="server" ImageUrl="~/skin/images/item-pointer.gif" /></asp:HyperLink>
                                              <asp:Label ID="lblTransferAccountName" runat=server />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                            <span>Cash Flow Item</span>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlCashFlow" runat="server">
                                            </asp:DropDownList>
                                        </td>

                                        <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                            <span>Transfer Date</span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtTransferDate" runat="server"  CssClass="txtDate"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                            <span>Cash Applied</span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCashApplied" runat="server"></asp:TextBox>
                                        </td>

                                         <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                            <span>Transfer Applied</span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtTransferApplied" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                            <span>Reference</span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtReference" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                  
                       </div>
                    </div>
                    <br />
                    <div>
                        
                    </div>
                    <div class="left">
                        <table class="detail_table">
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Journal Remarks</span>
                                </td>
                                <td class="detail_table_td_100">
                                    <asp:TextBox ID="txtJournalRemark" runat="server" Width="420px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Remark</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtRemarks" runat="server" Height="40px" TextMode="MultiLine" Width="420px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="right">
                        <table class="detail_table">
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                     <asp:CheckBox ID="ckPaymentOnAccount" runat=server text="" 
                                         oncheckedchanged="ckPaymentOnAccount_CheckedChanged" AutoPostBack=true/>
                                     <span>Payment on Account</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPaymentOnAccount" Enabled=false Style="text-align: right" runat="server" AutoPostBack=true/>
                                </td>
                                
                                
                            </tr>
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                    <span>Tax</span>
                                </td>
                                <td>
                                    <asp:TextBox Enabled="false" ID="txtTax" Style="text-align: right" runat="server"
                                        ReadOnly="true"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_150" style="border-bottom: dotted 1px #808080;">
                                    <span>Total Payment Due</span>
                                </td>
                                <td>
                                    <asp:TextBox Enabled="false" ID="txtTotalPayment" Style="text-align: right" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="clear">
                    </div>
                    <div class="left">
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="clear">
                </div>
                <div id="footer-form">
                    <div>
                        <asp:ImageButton ID="btnAdd" runat="server" AlternateText="button" OnClientClick="Dialog.showLoader();"
                            CommandName="Login" Height="19px" Width="65px" ImageUrl="~/skin/images/SAP_Add.png"
                            OnClick="btnAdd_Click" />
                        <asp:ImageButton ID="btnselectall" runat="server" AlternateText="button" 
                            CommandName="Login" Height="19px" Width="95px" ImageUrl="~/skin/images/selectall.png"
                            OnClick="btnselectall_Click" />
                        <asp:ImageButton ID="btnDeselect" runat="server" AlternateText="button" 
                            CommandName="Login" Height="19px" Width="95px" ImageUrl="~/skin/images/deselectall.png"
                            OnClick="btnDeselect_Click" />
                    </div>
                    <div class="right">
                        
                    </div>
                    <div class="clear">
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
